package com.zbkj.crmeb.task.plat.poizon.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

/**
 * @author Zhangxuyang
 * @date 4/22/2024 9:20 上午
 */
@NoArgsConstructor
@Data
public class PoizonResponseBodyDto<T> {

    private Long code;
    private String msg;
    private T data;
    private Integer status;

    @NoArgsConstructor
    @Data
    public static class LoginDataDTO {
        private String accessToken;
        private String refreshToken;
        private String language;
        private String timeZone;
        private String tenantName;
        private String userName;
    }

    @NoArgsConstructor
    @Data
    public static class RefreshTokenDataDTO {
        private String accessToken;
    }

    @NoArgsConstructor
    @Data
    public static class PushStockUpdateDataDTO {
        private Boolean pushResult;
        private FailEntryDTO failEntry;

        @NoArgsConstructor
        @Data
        public static class FailEntryDTO {
            private String spuId;
            private List<String> message;
        }
    }

    @NoArgsConstructor
    @Data
    public static class UpdateStocksAndPricesDataDTO {
        private Boolean updateResult;
        private List<FailDataDTO> failList;

        @NoArgsConstructor
        @Data
        public static class FailDataDTO {
            private String spuId;
            private String skuId;
            private Set<String> message;
        }
    }

    @NoArgsConstructor
    @Data
    public static class RetrieveOrdersDataDTO {
        private Integer pageNum;
        private Integer pageSize;
        private Integer total;
        private Integer pages;
        private List<RetrieveOrdersDataDTO.ContentDTO> contents;

        @NoArgsConstructor
        @Data
        public static class ContentDTO {
            private String channelOrderNo;
            private String orderStatus;
            private List<String> orderNodeList;
            private String createTime;
            private String modifyTime;
            private String orderSheetLink;
            private Integer hasReRoute;
            private ProductDetail productDetail;

            @NoArgsConstructor
            @Data
            public static class ProductDetail {
                private String productName;
                private String articleNumber;
                private String size;
                private BigDecimal price;
                private Integer quantity;
                private String skuId;
                private String spuId;
            }
        }
    }

    @NoArgsConstructor
    @Data
    public static class OrderConfirmDataDTO {
        private Boolean result;
        private String orderSheetLink;
    }

    @NoArgsConstructor
    @Data
    public static class OrderCancelDataDTO {
        private Boolean result;
    }

    @NoArgsConstructor
    @Data
    public static class QueryOrderInfoDataDTO {
        private String channelOrderNo;
        private String orderStatus;
        private Long createTime;
        private Long modifyTime;
        private Integer hasReRoute;
        private String orderSheetLink;
        private ProductDetailDTO productDetail;

        @NoArgsConstructor
        @Data
        public static class ProductDetailDTO {
            private String productName;
            private String articleNumber;
            private String size;
            private Double price;
            private Integer quantity;
            private String skuId;
            private String spuId;
        }
    }

    @NoArgsConstructor
    @Data
    public static class OrderCancelReasonEnum {
        private String code;
        private String desc;
    }

    @NoArgsConstructor
    @Data
    public static class SkuListDataDTO {
        private Integer pageNum;
        private Integer pageSize;
        private Integer total;
        private Integer pages;
        private List<ContentsDTO> contents;

        @NoArgsConstructor
        @Data
        public static class ContentsDTO {
            private String merchantName;
            private String spuId;
            private String skuId;
            private String retailPrice;
            private String dutyFreePrice;
            private String taxPurchasePrice;
            private String purchasePrice;
            private Integer stock;
            private List<String> images;
            private String createTime;
            private String modifyTime;
        }
    }

    @NoArgsConstructor
    @Data
    public static class BrandDataDTO {
        private Long id;
        private String brandName;
    }

    @NoArgsConstructor
    @Data
    public static class CategoryDataDTO {
        private Long id;
        private Integer pid;
        private Integer level;
        private String categoryName;
    }

    @NoArgsConstructor
    @Data
    public static class GenderDataDTO {
        private Long id;
        private String genderName;
    }
}
